package com.atguigu.springcloud.alibaba.controller;

import com.atguigu.springcloud.alibaba.service.NoticeService;
import com.atguigu.springcloud.entities.CommonResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @ClassName NoticeController
 * @Desscription
 * @Author _HeiShuai
 * @Date 2023/1/12 15:16
 * @Version 1.0
 **/
@RestController
@Slf4j
public class NoticeController {

    @Resource
    private NoticeService noticeService;

    @GetMapping("/notice/create")
    public CommonResult create(@RequestParam("userId")Long userId, @RequestParam("content") String content) {
        noticeService.create(userId, content);
        return new CommonResult(200, "消息发送成功");
    }


}
